﻿Shader "Hidden/StickerPenShader"
{
    Properties
    {

    }
    SubShader
    {
        Tags { "Queue"="Transparent" }
        LOD 100
        Cull Off ZWrite Off ZTest Always Fog{ Mode Off }

        Blend SrcAlpha OneMinusSrcAlpha, One OneMinusSrcAlpha

        Pass
        {
            CGPROGRAM
            #pragma vertex vert
            #pragma fragment frag

            #include "UnityCG.cginc"

            struct appdata
            {
                float4 vertex : POSITION;
                float2 uv : TEXCOORD0;
            };

            struct v2f
            {
                float2 uv : TEXCOORD0;
                float4 vertex : SV_POSITION;
            };
            
            sampler2D _StickerTex;
            float4 _Color;
            float4x4 _ProjectMatrix;

            v2f vert (appdata v)
            {
                v2f o;
                o.vertex.xy = mul(_ProjectMatrix, v.vertex).xy;
                o.vertex.y = -o.vertex.y;
                o.vertex.zw = v.vertex.zw;
                o.uv = v.uv;
                return o;
            }

            float4 frag(v2f i) : SV_Target
            {
                return tex2D(_StickerTex, i.uv);// *_Color;
            }
            ENDCG
        }
    }
}
